<include file="Common/header" />
<title>会员录入</title>
</head>
<body>
<div class="pd-20">
	<form action="" method="post" class="form form-horizontal" id="form-user-character-add" enctype="multipart/form-data">
		<div class="panel panel-primary">
			<div class="panel-header">基本信息</div> 
			<table class="table table-border table-bordered table-striped">
	            <tr>
	                <td style="background-color: #f9f9f9;text-align: right">房间号：</td>
	                <td style="background-color: white;">
						<input type="text" class="input-text radius" value="{$info['roomnumber']}" readonly />
	                </td>
	                <td style="background-color: #f9f9f9;text-align: right">抄表月份：</td>
	                <td style="background-color: white">
						<input type="hidden" name="id" id="id" value="{$info['id']}" />
						<input type="text" class="input-text radius" value="{$info['month']}" readonly />
					</td>
	            </tr>
				<tr>
					<td style="background-color: #f9f9f9;text-align: right">水表读数：</td>
	                <td style="background-color: white">
						<input type="text" name="water" id="water" class="input-text radius" value="{$info['water']}" />
					</td>
					<td style="background-color: #f9f9f9;text-align: right">水费单价：</td>
	                <td style="background-color: white">
						<input type="text" name="water_price" id="water_price" class="input-text radius" value="{$info['water_price']}" />
					</td>
				</tr>
				
				<tr>
					<td style="background-color: #f9f9f9;text-align: right">电表读数：</td>
	                <td style="background-color: white">
						<input type="text" name="electric" id="electric" class="input-text radius" value="{$info['electric']}" />
					</td>
					<td style="background-color: #f9f9f9;text-align: right">电费单价：</td>
	                <td style="background-color: white">
						<input type="text" name="electric_price" id="electric_price" class="input-text radius" value="{$info['electric_price']}" />
					</td>
				</tr>
				
				<tr>
					<td style="background-color: #f9f9f9;text-align: right">气表读数：</td>
	                <td style="background-color: white">
						<input type="text" name="gas" id="gas" class="input-text radius" value="{$info['gas']}" />
					</td>
					<td style="background-color: #f9f9f9;text-align: right">气费单价：</td>
	                <td style="background-color: white">
						<input type="text" name="gas_price" id="gas_price" class="input-text radius" value="{$info['gas_price']}" />
					</td>
				</tr>
				<tr>
					<td class="text-c" colspan="4">
						<button type="button" class="btn btn-success radius submitBtn" id="admin-role-save" name="admin-role-save"><i class="icon-ok"></i> 确定</button>
					</td>
				</tr>
			</table>
		</div>
	</form>
</div>
<script>
	$(document).ready(function(){
		$(".time").on('click', function(){
			laydate({istime: true, format: 'YYYY-MM-DD'});
		});

		/**
		 * 提交数据
		 **/
		$(".submitBtn").on('click', function(){
			var load = layer.load(2);
			$.post('edit.html', $("#form-user-character-add").serialize(), function(data){
				layer.close(load);
				if(data/1){
					layer.msg('编辑成功', {icon: 1, time: 2000}, function(){
						window.parent.location.reload(); //刷新
						var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                    	parent.layer.close(index);
					});
				}else{
					layer.msg('编辑失败', {icon: 2, time: 2000});
				}
			});
		});
	});
</script>
</body>
</html>